#ifndef     __MDB_TASK_H
#define     __MDB_TASK_H

#include "../rtos/thread.h"
#include "../rtos/message_queue.h"
#include "../conn/message.h"

namespace task {

class MdbTask : public rtos::Thread<MdbTask, 1024, osPriorityHigh1> {

public:
    void init_start() {
        m_mq.init();
        start();
    }

    void run();
    void post(const conn::Message &msg) {
        m_mq.post(msg);
    }
private:
    rtos::MessageQueue<conn::Message, 5> m_mq;
};

extern MdbTask mdbTask;

}

#endif
